package com.wuyou.single.common.security.filter;

import com.wuyou.single.common.util.JwtTokenUtil;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 请求过滤器
 */
@Component
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {


    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        // 1. 获取Token
        // 2. 校验Token有效性
        // 2.1 是否系统签发
        // 2.2 Token中的用户信息是否有效
        // 2.3 是否过期

        filterChain.doFilter(request, response);
    }
}
